<!--
 * @Author: MrLee
 * @Date: 2024-08-22 21:44:44
 * @LastEditors: MrLee
 * @LastEditTime: 2024-08-24 20:00:08
 * @Description: 请填写简介
-->
<template>
  <view
    class="flex flex-wrap items-start justify-start w-full shadow-[0px_6px_12px_0px_rgba(235,235,235,0.30)] p-[20rpx] pb-0 rounded-[44rpx] bg-#ffffff"
  >
    <view
      v-for="(item, index) in menuList"
      :key="index"
      style="width: 25%"
      class="flex mb-[20rpx] flex-col items-center justify-center"
      @click="toPage(item)"
    >
      <image class="h-[56rpx] w-[56rpx] block mb-[10rpx]" :src="item.ico" />
      <view class="text-[24rpx] font-medium text-[#1d2129]">{{
        item.text
      }}</view>
    </view>
  </view>
</template>

  <script setup lang="ts">
const props = defineProps({
  menuList: Array,
});
const toPage = (item: any) => {
  if(item.text === '公司主页') {
    let storage = JSON.parse(uni.getStorageSync('user')).info
    item.url = item.url + '?company_id=' + storage.hr.company_id
  }
  uni.navigateTo({
    url: item.url,
  });
};
</script>
